home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxdither.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.2 KB  |  79 lines

  1. /* Copyright (C) 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxdither.h,v 1.2 2000/09/19 19:00:36 lpd Exp $ */
  20. /* Interface to gxdither.c */
  21.  
  22. #ifndef gxdither_INCLUDED
  23. #  define gxdither_INCLUDED
  24.  
  25. #include "gxfrac.h"
  26.  
  27. #ifndef gx_device_halftone_DEFINED
  28. #  define gx_device_halftone_DEFINED
  29. typedef struct gx_device_halftone_s gx_device_halftone;
  30. #endif
  31.  
  32. /*
  33.  * Note that in the procedures below, the colors are specified by fracs,
  34.  * but the alpha value is a gx_color_value.  This is a design flaw that
  35.  * we might be able to fix eventually.
  36.  */
  37.  
  38. /* Render a gray, possibly by halftoning. */
  39. /* Return 0 if complete, 1 if caller must do gx_color_load, <0 on error. */
  40. int gx_render_device_gray(P6(frac gray, gx_color_value alpha,
  41.                  gx_device_color * pdevc, gx_device * dev,
  42.                  gx_device_halftone * dev_ht,
  43.                  const gs_int_point * ht_phase));
  44.  
  45. #define gx_render_gray_alpha(gray, alpha, pdevc, pis, dev, select)\
  46.   gx_render_device_gray(gray, alpha, pdevc, dev, pis->dev_ht,\
  47.             &pis->screen_phase[select])
  48. #define gx_render_gray(gray, pdevc, pis, dev, select)\
  49.   gx_render_gray_alpha(gray, pis->alpha, pdevc, pis, dev, select)
  50.  
  51. /* Render a color, possibly by halftoning. */
  52. /* Return as for gx_render_[device_]gray. */
  53. int gx_render_device_color(P10(frac red, frac green, frac blue, frac white,
  54.                    bool cmyk, gx_color_value alpha,
  55.                    gx_device_color * pdevc, gx_device * dev,
  56.                    gx_device_halftone * pdht,
  57.                    const gs_int_point * ht_phase));
  58.  
  59. #define gx_render_color_alpha(r, g, b, w, a, cmyk, pdevc, pis, dev, select)\
  60.   gx_render_device_color(r, g, b, w, cmyk, a, pdevc, dev,\
  61.              pis->dev_ht, &pis->screen_phase[select])
  62. #define gx_render_color(r, g, b, w, cmyk, pdevc, pis, dev, select)\
  63.   gx_render_color_alpha(r, g, b, w, pis->alpha, cmyk, pdevc, pis, dev, select)
  64. #define gx_render_rgb(r, g, b, pdevc, pis, dev, select)\
  65.   gx_render_color(r, g, b, frac_0, false, pdevc, pis, dev, select)
  66. #define gx_render_cmyk(c, m, y, k, pdevc, pis, dev, select)\
  67.   gx_render_color(c, m, y, k, true, pdevc, pis, dev, select)
  68. #define gx_render_rgb_alpha(r, g, b, a, pdevc, pis, dev, select)\
  69.   gx_render_color_alpha(r, g, b, frac_0, a, false, pdevc, pis, dev, select)
  70.  
  71. /*
  72.  * Reduce a colored halftone with 0 or 1 varying plane(s) to a pure color
  73.  * or a binary halftone.
  74.  */
  75. int gx_reduce_colored_halftone(P3(gx_device_color *pdevc, gx_device *dev,
  76.                   bool cmyk));
  77.  
  78. #endif /* gxdither_INCLUDED */
  79.